home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 113 / XENIATGM113.iso / Patch / No One Lives Forever / NOLFUpdate003.exe / Setup / Swedish / swedish.rul < prev    next >
Text File  |  2001-04-25  |  3KB  |  107 lines

  1. //
  2. // SWEDISH UPDATE setup.rul
  3. //
  4. // NOTE:  Changes made to this script should be made to the scripts for each 
  5. //          other language too!
  6. //
  7.  
  8. // Game & folder names
  9. #define APP_TITLE       "NOLF-uppdatering (v1.003)"
  10. #define APP_NAME        "No One Lives Forever"
  11. #define APP_VERSION     "1.0"
  12. #define APP_KEY         "NOLF.exe"
  13. #define DEFAULT_PATH    "Fox\\No One Lives Forever"
  14. #define DEFAULT_GROUP   "Fox Interactive\\No One Lives Forever"
  15. #define UPDATE_VERSION    "1.003"
  16. #define UPDATE_COMMAND    "-rez Nolfu003.rez -rez Nolfcres003.rez"
  17. #define README_FILE        "READMEU003.TXT"
  18.  
  19. declare
  20.     NUMBER  nResult;
  21.     NUMBER  nType, nSize;
  22.     STRING  svSrcDir, svTargetDir;
  23.     STRING  svRegKey;
  24.     STRING  svTemp;
  25.     STRING  svVersion;
  26.  
  27. program
  28. start:
  29.     // Set paths
  30.     svSrcDir     = SRCDIR ^ "..\\..\\";
  31.  
  32.     // Setup screen & title
  33.     Enable(BACKGROUND);
  34.     SetColor(BACKGROUND, RGB(236, 164, 4));
  35.     SetTitle(APP_TITLE, 26, WHITE);
  36.  
  37.     SetColor(STATUSBAR, BK_SOLIDBLUE);
  38.     PlaceBitmap(svSrcDir ^ "SETUP\\NOLF1.BMP", 1, CENTERED, CENTERED, CENTERED);
  39.     Delay(2);
  40.  
  41.     // Get installed path from registry
  42.     RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  43.     svRegKey = "Software\\Monolith Productions\\" + APP_NAME + "\\" + APP_VERSION;
  44.     nType = REGDB_STRING;
  45.     nSize = -1;
  46.     nResult = RegDBGetKeyValueEx(svRegKey, "WorkingDirectory", nType, svTargetDir, nSize);
  47.     if (nResult < 0) then
  48.  
  49.         svTemp = "Kan inte uppdatera " + APP_NAME + " till version " + UPDATE_VERSION + 
  50.                  ". Kontrollera att " + APP_NAME + " Σr korrekt installerat!";
  51.  
  52.         MessageBox(svTemp, WARNING);
  53.         exit;
  54.     endif;
  55.  
  56.     // Check version number of what's already installed
  57.     nType = REGDB_STRING;
  58.     nSize = -1;
  59.     nResult = RegDBGetKeyValueEx(svRegKey, "Version", nType, svVersion, nSize);
  60.     if (nResult = 0) then
  61.         nResult = StrCompare(svVersion, UPDATE_VERSION);
  62.         if (nResult > 0) then
  63.  
  64.             svTemp = "Du k÷r f÷r nΣrvarande v" + svVersion + " av " + APP_NAME +
  65.                      ".\n\nDu kan inte uppdatera till v" + UPDATE_VERSION + 
  66.                      ".\n\nDu kan ladda ner de senaste uppdateringarna till " + APP_NAME +
  67.                      " pσ: http://www.the-operative.com";
  68.          
  69.             MessageBox(svTemp, INFORMATION);
  70.             exit;
  71.         endif;
  72.     endif;
  73.  
  74.     // Show status window
  75.     Disable(FEEDBACK_FULL);
  76.     Enable(STATUS);
  77.     Enable(INDVFILESTATUS);
  78.     PlaceWindow(STATUS, CENTERED, 0, LOWER_RIGHT);
  79.     SetStatusWindow(0, "Uppdaterar " + APP_NAME + "...");
  80.  
  81.     // Copy all game files...
  82.     StatusUpdate(ON, 100);
  83.     SRCDIR    = svSrcDir ^ "GAME";
  84.     TARGETDIR = svTargetDir;
  85.     CopyFile("*.*", "*.*");
  86.  
  87.     // Copy language-specific files...
  88.     SRCDIR = svSrcDir ^ "GAME\\SWEDISH";
  89.     CopyFile("*.*", "*.*");
  90.  
  91.     // Display done message
  92.     SetStatusWindow(1000, "Uppdateringen klar!");
  93.  
  94.     // Set new registry keys
  95.     RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  96.     RegDBSetKeyValueEx(svRegKey, "Version", REGDB_STRING, UPDATE_VERSION, -1);
  97.     RegDBSetKeyValueEx(svRegKey, "Update Command Line", REGDB_STRING, UPDATE_COMMAND, -1);
  98.  
  99.     // Do the readme...
  100.  
  101.     svTemp = "Uppdateringen av " + APP_NAME + " Σr klar! Vill du lΣsa README-filen nu?";
  102.  
  103.     if (AskYesNo(svTemp, YES) = YES) then
  104.        LaunchAppAndWait("NOTEPAD.EXE " + svTargetDir ^ README_FILE, "", NOWAIT);
  105.     endif;
  106.  
  107. exit;